<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org/">
<head>
    <title>主页</title>

    <link rel="stylesheet" type="text/css"  th:href="@{/static/layui/css/layui.css}"/>
    <script th:src="@{/static/layui/layui.js}" type="text/javascript" charset="utf-8"></script>

</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo">JAVA-0000</div>
        <ul class="layui-nav layui-layout-left">   </ul>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <a href="javascript:;">
                    <!--<%&#45;&#45; 				        <img src="<%=path%>/img/fei.png" &#45;&#45;%>
                    &lt;!&ndash; 				        class="layui-nav-img"/> &ndash;&gt;-->
                    <img width="40px" height="30px" th:src="@{/pic/{image}(image=${session.researchers.image})}"/> <th:block th:text="${session.researchers.name}"></th:block>
                </a>
                <dl class="layui-nav-child">
                    <dd>
                        <a href="javascript:openUser()">基本资料</a>
                    </dd>
                    <dd>
                        <a href="javascript:openPass()">修改密码</a>
                    </dd>
                    <dd>
                        <a href="javascript:openPic()">修改头像</a>
                    </dd>
                </dl>
            </li>
            <li class="layui-nav-item">
                <a href="javascript:logout()">注销</a>
            </li>
        </ul>
    </div>



    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree" >
                <li class="layui-nav-item layui-nav-itemed">
                    <a href="javascript:;">信息维护</a>
                    <dl class="layui-nav-child">
                        <th:block th:each="auth : ${session.authList}">
                            <dd>
                                <a href="javascript:;" th:data-url="@{${auth.path}}" th:text="${auth.name}" class="site-demo-active"></a>
                            </dd>
                        </th:block>


                        <!--<dd>
                        <a href="javascript:;"
                           data-url="/page/researchers/list"
                           class="site-demo-active">科研人员管理</a>
                    </dd>
                        <dd>
                            <a href="javascript:;"
                               data-url="/page/project/list"
                               class="site-demo-active">项目管理</a>
                        </dd>
                        <dd>
                            <a href="javascript:;"
                               data-url="/auth/list"
                               class="site-demo-active">权限管理</a>
                        </dd>
                        <dd>
                            <a href="javascript:;"
                               data-url="/page/personal/info"
                               class="site-demo-active">个人信息</a>
                        </dd>
                        <dd>
                            <a href="javascript:;"
                               data-url="/page/personal/project"
                               class="site-demo-active">我的项目</a>
                        </dd>
                        <dd>
                            <a href="javascript:;"
                               data-url="/echarts.jsp"
                               class="site-demo-active">统计图表</a>
                        </dd>-->

                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">基础配置</a>
                    <dl class="layui-nav-child">
                        <dd>
                            <a href="javascript:;"
                               class="site-demo-active"
                               data-url="/com.situ.web/page/dict/dictlist.jsp">
                                基础数据维护</a>
                        </dd>
                        <dd>
                            <a href="javascript:;" class="site-demo-active"
                               data-url="/com.situ.web/404.jsp">404-1</a>
                        </dd>
                    </dl>
                </li>
            </ul>
        </div>
    </div>
    <div class="layui-body"><!-- 内容主体区域 -->
        <iframe name="rightframe" width="99%" height="97%" src="/echarts.jsp"></iframe>
    </div>
    <div class="layui-footer">© JAVA - 底部固定区域</div>
</div>
<script type="text/javascript">

    var $ = layui.jquery;
    var layer = layui.layer;
    var element = layui.element;
//upload picture
   /* function openPic() {
        $.post(
            'researchers/updateById',
            [[${session.researchers}]]

        )
    }*/


    $('.site-demo-active').click(function() {
        window.open($(this).data('url'), "rightframe");
    });
    element.render();// element.init();
    function openURL(url){
        window.open(url, "rightframe");
    }

    function logout() {
        layer.confirm('您确认要退出么?', {icon: 3}, function () {
            $.post(
                '/researchers/logout',
                function (result) {
                    if (result.code == 0) {
                        location.href = '/page/login';
                    }
                },
                'json'
            );
        })
    }
    //个人信息弹窗
    function openUser() {
        layui.use('layer', function() {
            var layer = layui.layer;
            layer.open({
                type: 2, // 选择iframe
                title: '基本资料',
                content: '/page/basic/info', // 弹窗内容的URL
                area: ['800px', '600px'], // 弹窗宽高
                maxmin: true // 是否允许全屏和最小化
            });
        });
    }
</script>
</body>
</html>